<!--河南星辰软件科技有限公司
@copyright Copyright (c) 2010~2022 All rights reserved.
-->
<template>
  <div>
    <el-form ref="form" :model="s_tech" :rules="rules" label-width="100px" id="mvcfm">
      <div class="form-unit">
        <span class="mvc-title-left"> 检测标准列表 </span>
      </div>
      <el-table :data="s_tech">
        <el-table-column label="" prop="tech_id" width="80">
          <template slot-scope="scope">
            <el-button @click="$parent.$parent.closeTestingStandardList(scope.row['tech_id'],scope.row['tech_name']);" type="success" size="mini"><i class="fa fa-edit"></i>选择</el-button>
          </template>
        </el-table-column>
        <el-table-column label="#" align="center" type='index'>
        </el-table-column>
        <el-table-column label="范围类别" prop="description">
        </el-table-column>
        <el-table-column label="检测标准" prop="tech_name">
        </el-table-column>
        <el-table-column label="产品类别" prop="pro_name">
        </el-table-column>
        <el-table-column label="标准文件编号" prop="subject">
        </el-table-column>
      </el-table>
      <pagination v-show="total>0" :total="total" :limit.sync="pageSize" @pagination="getPage" />
    </el-form>
  </div>
</template>
<script>
  import request from '@/utils/request'
  export default {
    name: 'TestingStandardList',
    components: {},
    props: ['popparams'],
    data() {
      return {
        vueparams: this.getVUEParams(""),
        s_tech: [],
        s_type: [],
        loading: false,
        rules: {}
      }
    },
    created() {
      this.getData();
    },
    updated() {},
    mounted() {},
    methods: {
      getData() {
        request({
          method: 'get',
          url: '/xcapi/VUEAction/mes/product/TechnologyAction/testingStandardList?' + this.vueparams,
        }).then(data => {
          for (var k in data) {
            if (Array.isArray(data[k])) {
              this[k] = data[k];
            } else {
              $.extend(this[k], data[k]);
            }
          }
        })
      },
      list_s_type(value) {
        if (this.$route.fullPath.indexOf("?") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "?CMID2=" + value);
        } else if (this.$route.fullPath.indexOf("CMID2=") == -1) {
          this.$router.replace("/redirect" + this.$route.fullPath + "&CMID2=" + value);
        } else {
          this.gotoPage("/redirect/mes/product/TestingStandardList?" + this.vueparams, {
            CMID2: value
          });
        }
      },
    },
  }
</script>
